package com.hfh.learn;

/**
 * @Author hfh
 * @Date 2022 09 14 21 04
 **/
public class StringDemo {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder("肥肠粉");
        System.out.println(sb.delete(1, 2).append("第三方").reverse().replace(2, 3, "ewe"));

        /*StringBuffer sb = new StringBuffer("我的天啊");
        System.out.println(sb.reverse());
        System.out.println(sb.delete(2,3));
        System.out.println(sb.insert(2, "随着").append("sdad"));*/

        /*String s1 = "ab";
        String s2 = "abkkcadkabkebfkabks";
        int count = 0;
        for (int i = 0;i<=(s2.length()-s1.length());i++){
            if(s1.equals(s2.substring(i,i+s1.length()))){
                count++;
            }
        }
        System.out.println(count);
*/

        /*int i = 11;
        System.out.println(String.valueOf(i));

        String s = "123";
        System.out.println(Integer.parseInt(s));
        System.out.println(Long.parseLong(s));*/

        /*String s = new String("  Wfww  ");
        System.out.println(s);
//        System.out.println(s.trim());
        System.out.println(s.replace('w', 'a'));
        System.out.println(s.replace("fw", "q"));*/
    }
}
